<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=0.5"/>
    <title>项目审批</title>
    <script src="/static/bflow/assets/js/scriptLib.js"></script>
    <!-- bootstrap-validator -->
    <script src="https://cdn.bootcss.com/1000hz-bootstrap-validator/0.11.9/validator.min.js"></script>
    <script src="/static/bflow/assets/js/bflow/example/negView.js"></script>
    <script src="/static/bflow/assets/js/bflow/common/auditUtil.js"></script>
    <script type="text/javascript">

        $(function () {
            //初始化 编辑页码标题
            PageUtil.initEditPageTitle("项目验证", "isValid")

            //初始化数据
            initViewData();

            setTimeout(function () {
                // 表单验证 http://1000hz.github.io/bootstrap-validator/
                $('#auditForm').validator().on('submit', function (e) {
                    if (e.isDefaultPrevented()) {
                        // handle the invalid form...
                    } else {
                        submitAuditForCommon("/example/neg/audit", function (message) {
                            refreshPage(1500, '/static/bflow/ui/example/neg/list.html');
                        })
                        return false;
                    }
                });
            }, 500);

        });

        // 初始化视图数据
        function initViewData(){
            var id = getBrowserQueryVar("taskId");
            if(CommUtil.isNotEmpty(id)){
                HttpUtil.ajaxAsyncJsonPost("/example/neg/getTask", {taskId: id}, function(bo){
                    console.log("data", bo);
                    FormUtil.bindViewData("viewTable", bo.instance);
                    //构建 处理记录
                    buildProcessRecordList(bo.instance.records);
                    $("#taskId").val(bo.id);
                    buildAuditRouteGroup("routeGroup", bo.actRoutes)
                });
            }
        }
    </script>
</head>
<body>
<div class="container">
    <div class="page-header">
        <h1><span id="pageTitle">项目审批</span>
            <small><a href="/index.html" class="btn btn-link">首页</a></small>
        </h1>
    </div>
    <ul class="nav nav-tabs">
        <li class=""><a href="/static/bflow/ui/example/neg/list.html">全部</a></li>
        <li class=""><a href="/static/bflow/ui/example/neg/assignList.html">分派</a></li>
        <li class=""><a href="/static/bflow/ui/example/neg/auditList.html?isValid=true"><span>验证中</span></a></li>
        <li class=""><a href="/static/bflow/ui/example/neg/auditList.html"><span>待审批</span></a></li>
        <li class="active"><a>审批</a></li>
    </ul>

    <table id="viewTable" class="table table-bordered">
        <tbody>
            <tr><th>流程ID:</th><td id="id"></td></tr>
            <tr><th>项目ID:</th><td id="extBigint2"></td></tr>
            <tr><th>项目名:</th><td id="extVarchar1"></td></tr>
            <tr><th>城市:</th><td id="extVarchar2"></td></tr>
            <tr> <th>提交人:</th><td id="startUname"></td></tr>
            <tr><th>议标ID:</th><td id="extBigint1"></td></tr>
            <tr><th>资源UUID:</th><td id="extVarchar3"></td></tr>
            <tr><th>资源网址:</th><td id="extVarchar4"></td></tr>
            <tr><th>企业法人身份证:</th><td id="extVarchar5"></td></tr>
            <tr><th>项目发布日期:</th><td id="extDatetime1"></td></tr>
            <tr><th>报名截止时间:</th><td id="extDatetime2"></td></tr>
            <tr><th>标的:</th><td id="extNumeric1"></td></tr>
            <tr><th>提交时间:</th><td id="createTime"></td></tr>
            <tr><th>审批记录:</th>
                <td class="audit-record-panel">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th width="150">环节</th>
                            <th width="130">操作人</th>
                            <th width="120">结论</th>
                            <th>备注</th>
                            <th width="140">操作时间</th>
                        </tr>
                        </thead>
                        <tbody id="processRecordTableTbody" class="audit-record-list"></tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="marg-left-10">
        <h4 class="h4">审批操作</h4>
        <script src="/static/bflow/assets/js/tpl/auditFormTpl.js"></script>
    </div>
</div>
</body>
</html>

